define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    dsBridge.register('create_ClassifyRender', function (sourceId, fieldName, labelField, showLabel, symbol) {
        var options = {
            symbol: Window.deserializer.createJsInstance(JSON.parse(symbol)),
            showLabel: showLabel || false,
            labelField: labelField,
            fieldName: fieldName,
            classfications: []
        };
        var classifyRender = new egis.render.ClassBreaksRenderer(options);
        Window.container[sourceId] = classifyRender;
    })

    dsBridge.register('ClassifyRender_addClassfication', function (sourceId, startValue, endValue, symbol) {
        var classfication = {
            startValue: startValue,
            endValue: endValue,
            symbol: Window.deserializer.createJsInstance(JSON.parse(symbol))
        }
        var classifyRender = Window.container[sourceId];
        classifyRender.classfications.push(classfication);
    })

    dsBridge.register('ClassifyRender_setLabelField', function (sourceId, labelField) {
        var classifyRender = Window.container[sourceId];
        classifyRender.labelField = labelField;
    })

    dsBridge.register('ClassifyRender_setShowLabel', function (sourceId, showLabel) {
        var classifyRender = Window.container[sourceId];
        classifyRender.showLabel = showLabel;
    })

    dsBridge.register('ClassifyRender_setSymbol', function (sourceId, symbol) {
        var classifyRender = Window.container[sourceId];
        classifyRender.symbol = Window.deserializer.createJsInstance(JSON.parse(symbol));
    })

    dsBridge.register('ClassifyRender_setFieldName', function (sourceId, fieldName) {
        var classifyRender = Window.container[sourceId];
        classifyRender.fieldName = fieldName;

    })
})